Conversation
- Require PHP 7.4+ and WP 5.5+ (so we can rely on wp_get_environment_type()) - Update all dependencies' requirements - Update code to be compliant with latest coding standards and Psalm - Deprecate "Spaces" hosting
| private const ENV_ALIASES = [ | ||
| 'local' => self::LOCAL, | ||
| 'development' => self::DEVELOPMENT, | ||
| 'dev' => self::DEVELOPMENT, | ||
| 'develop' => self::DEVELOPMENT, | ||
| 'staging' => self::STAGING, | ||
| 'stage' => self::STAGING, | ||
| 'preprod' => self::STAGING, | ||
| 'pre-prod' => self::STAGING, | ||
| 'pre-production' => self::STAGING, | ||
| 'test' => self::STAGING, | ||
| 'uat' => self::STAGING, | ||
| 'production' => self::PRODUCTION, | ||
| 'prod' => self::PRODUCTION, | ||
| 'live' => self::PRODUCTION, | ||
| ]; |
There was a problem hiding this comment.
This was replaced by using wp_get_environmen_type(). Will this affect current systems which are using the non-defined WordPress env types (local, development, staging, production)?
There was a problem hiding this comment.
The replaced code was still reducing the env names to the one supported by WP. Because after being obtained, the environment was "normalized" to one of the class constants which are exactly the values returned by wp_get_environmen_type().
Moreover, if you were using a WP version that has wp_get_environment_type() available (and considering that's 5.5+ chances are you are) the class was already using wp_get_environment_type().
In short, this change is just removing a good amount of complexity that was there just to account for WP < 5.5, which we don't want to care anymore...
Chrico
left a comment
There was a problem hiding this comment.
Looks good to me so far. Only have 1 question regarding the replacment of our ENV_ALIAS with the wp_get_enviornment_type() core function.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Maintenance.
What is the current behavior? (You can also link to an open issue here)
N/A
What is the new behavior (if this is a feature change)?
No new behavior.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
Other information:
wp_get_environment_type())